<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets"
  xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html" template="../template_back.xhtml">
  
  <ui:define name="content">
  	<div class="book-image">
	    <p:graphicImage value="#{bookController.photo}">
	    	<f:param name="bookId" value="#{bookController.currentBook.id}" />
	    </p:graphicImage>
	</div>
    <h:form id="contentForm"  enctype="multipart/form-data">
    
      <h:panelGrid columns="3">
      
        <h:outputText value="Titre livre" />
        <p:inputText id="title" value="#{bookController.currentBook.title}" required="true"/>
        <h:message for="title"></h:message>

        <h:outputText value="Prix livre" />
        <p:inputText id="price" value="#{bookController.currentBook.price}" required="true" />
        <h:message for="price"></h:message>
        
<!-- 		<p:fileUpload value="#{bookController.file2}" mode="simple" /> -->
        
        <h:outputText value="Liste categories " />        
		<p:selectOneMenu value="#{bookController.currentBook.category}" converter="#{categoryConverter}">
		    <f:selectItems value="#{categoryController.categories}" var="cat" itemValue="#{cat}" itemLabel="#{cat.title}" />
		</p:selectOneMenu>
		
		
		<h:outputText value="Auteurs" />  
		<p:selectManyMenu  id="scroll" value="#{bookController.tempAuthor}" converter="#{authorConverter}" style="width:150px;height:200px" var="p" showCheckbox="true">  >
			<f:selectItems value="#{authorController.authors}" var="aut" itemValue="#{aut}" itemLabel="#{aut.firstName}" />
			
			<p:column>  
                #{p.firstName} 
            </p:column>  
            
		</p:selectManyMenu>
		                                
      </h:panelGrid>
      <p:commandButton action="#{bookController.edit1}" value="Enregistrer les modifications">
      	<f:param name="bookId" value="#{bookController.currentBook.id}"/>
      </p:commandButton> 
      <h:messages globalOnly="true"/>
      
    </h:form>  
  
  </ui:define>
  
</ui:composition>
